<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNoticesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('notices', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('agent_id')->index()->comment('代理ID');
            $table->string('cover_image_url')->nullable()->comment('封面图版链接');
            $table->string('title', 256)->comment('公告标题');
            $table->longText('content')->comment('公告内容');
            $table->dateTime('publish_time')->comment('发布时间');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('notices');
    }
}
